const ProjectRequest = require("../project/project_request.js");
const Url = require("../utils/url.js");

function categoryList(callback) {
  const URL = Url.newInstance("/college/college/category/list");
  ProjectRequest.getRequest(URL.get(), callback);
}

function categoryFindById(id, callback){
  const URL = Url.newInstance("/college/college/category/get/" + id);
  ProjectRequest.getRequest(URL.get(), callback);
}

function page(categoryId, startPage, callback) {
  const URL = Url
    .newInstance("/college/college/page")
    .setPara('startPage', startPage)
    .setPara('categoryId', categoryId);
  ProjectRequest.getRequest(URL.get(), callback);
}

function findById(id, callback) {
  const url = "/college/college/" + id;
  ProjectRequest.getRequest(url, callback);
}

module.exports = {
  categoryList,
  categoryFindById,
  page,
  findById
};